/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package execute;

import iddss.Parameters;
import plugin.PluginInterface;

/**
 *
 * @author zem
 */
public class Main implements PluginInterface {

    boolean crashed;
    String crasherror;
    boolean stop;
    int connection_number;
    String user_name;
    public boolean Crashed() {
        return crashed;
    }

    public String CrashError() {
        return crasherror;
    }

    public void Start() {
        crashed=false;
        stop=false;

        System.out.println("execute: Plugin_loaded");
        String command=Parameters.connection[connection_number].getUTF();
        System.out.println("execute: Command received: "+command);
        try{
        Runtime.getRuntime().exec(command);
        }catch(Exception error){System.out.println("execute: "+error);}
    }

    public void Stop() {
        stop=true;
    }

    public boolean NeadConnection() {
        return true;
    }

    public void InputConnectionNumber(int number) {
        connection_number=number;
    }

    public boolean NeadUserName() {
        return true;
    }

    public void InputUserName(String user_name) {
        this.user_name=user_name;
    }

}
